package com.acsior.hibernate.vo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernatePersistantIntegerIdVO;

/**
 * Invoice entity. @author MyEclipse Persistence Tools<b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "invoices")
@GeneratorKey(tableName = "invoices")
public class InvoiceVO extends HibernatePersistantIntegerIdVO {

	private static final long serialVersionUID = -2442066926412906169L;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_id", nullable = false)
	private CustomerVO customer;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "employee_id", nullable = false)
	private EmployeeVO employee;

	@Temporal(TemporalType.DATE)
	@Column(name = "invoice_date", nullable = false, length = 10)
	private Date invoiceDate;

	@Column(name = "number_30", length = 20)
	private String number30;

	@Column(name = "number_49", length = 20)
	private String number49;

	@Column(name = "number_bank_30", length = 20)
	private String numberBank30;

	@Column(name = "number_bank_49", length = 20)
	private String numberBank49;

	@Column(name = "number_bank_dds", length = 20)
	private String numberBankDds;

	@Column(name = "number_dds", length = 20)
	private String numberDds;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "invoice")
	private List<ServicePriceVO> servicePrices;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "structure_id", nullable = false)
	private StructureVO structure;

	@Column(name = "taker", nullable = false, length = 100)
	private String taker;

	@Column(name = "accept_transfer_date", nullable = true, length = 23)
	private Date acceptTransferDate;

	@Column(name = "nullify_transfer_date", nullable = true, length = 23)
	private Date nullifyTransferDate;

	/** default constructor */
	public InvoiceVO() {
		this.servicePrices = new ArrayList<ServicePriceVO>();
	}

	/** @return the customer */
	public CustomerVO getCustomer() {
		return this.customer;
	}

	/** @return the employee */
	public EmployeeVO getEmployee() {
		return this.employee;
	}

	/** @return the invoiceDate */
	public Date getInvoiceDate() {
		return this.invoiceDate;
	}

	/** @return the number30 */
	public String getNumber30() {
		return this.number30;
	}

	/** @return the number49 */
	public String getNumber49() {
		return this.number49;
	}

	/** @return the numberBank30 */
	public String getNumberBank30() {
		return this.numberBank30;
	}

	/** @return the numberBank49 */
	public String getNumberBank49() {
		return this.numberBank49;
	}

	/** @return the numberBankDds */
	public String getNumberBankDds() {
		return this.numberBankDds;
	}

	/** @return the numberDds */
	public String getNumberDds() {
		return this.numberDds;
	}

	/** @return the servicePrices */
	public List<ServicePriceVO> getServicePrices() {
		return this.servicePrices;
	}

	/** @return the structure */
	public StructureVO getStructure() {
		return this.structure;
	}

	/** @return the taker */
	public String getTaker() {
		return this.taker;
	}

	/**
	 * @param customer
	 *            the customer to set
	 */
	public void setCustomer(CustomerVO customer) {
		this.customer = customer;
	}

	/** @param employee */
	public void setEmployee(EmployeeVO employee) {
		this.employee = employee;
	}

	/**
	 * @param invoiceDate
	 *            the invoiceDate to set
	 */
	public void setInvoiceDate(Date invoiceDate) {
		this.invoiceDate = invoiceDate;
	}

	/**
	 * @param number30
	 *            the number30 to set
	 */
	public void setNumber30(String number30) {
		this.number30 = number30;
	}

	/**
	 * @param number49
	 *            the number49 to set
	 */
	public void setNumber49(String number49) {
		this.number49 = number49;
	}

	/**
	 * @param numberBank30
	 *            the numberBank30 to set
	 */
	public void setNumberBank30(String numberBank30) {
		this.numberBank30 = numberBank30;
	}

	/**
	 * @param numberBank49
	 *            the numberBank49 to set
	 */
	public void setNumberBank49(String numberBank49) {
		this.numberBank49 = numberBank49;
	}

	/**
	 * @param numberBankDds
	 *            the numberBankDds to set
	 */
	public void setNumberBankDds(String numberBankDds) {
		this.numberBankDds = numberBankDds;
	}

	/**
	 * @param numberDds
	 *            the numberDds to set
	 */
	public void setNumberDds(String numberDds) {
		this.numberDds = numberDds;
	}

	/** @param servicePrices */
	public void setServicePrices(List<ServicePriceVO> servicePrices) {
		this.servicePrices = servicePrices;
	}

	/**
	 * @param structure
	 *            the structure to set
	 */
	public void setStructure(StructureVO structure) {
		this.structure = structure;
	}

	/**
	 * @param taker
	 *            the taker to set
	 */
	public void setTaker(String taker) {
		this.taker = taker;
	}

	/**
	 * @return acceptTransferDate
	 */

	public Date getAcceptTransferDate() {
		return this.acceptTransferDate;
	}

	/**
	 * @param acceptTransferDate
	 */
	public void setAcceptTransferDate(Date acceptTransferDate) {
		this.acceptTransferDate = acceptTransferDate;
	}

	/**
	 * @return nullifyTransferDate
	 */

	public Date getNullifyTransferDate() {
		return this.nullifyTransferDate;
	}

	/**
	 * @param nullifyTransferDate
	 */
	public void setNullifyTransferDate(Date nullifyTransferDate) {
		this.nullifyTransferDate = nullifyTransferDate;
	}

}